package com.hangzhou.xyj.net.request;

import com.google.gson.Gson;
import com.google.gson.JsonObject;
import com.hangzhou.xyj.net.request.base.BaseRequest;
import com.hangzhou.xyj.utils.constants.API;

/**
 * Created by yaohuix on 2016/3/4  16:54
 * <p/>
 * 说明：获取圈子信息
 */
public class GetGroupsInfoReq extends BaseRequest {

    /**
     * 获取单个圈子的信息的构造方法
     *
     * @param groupIds 圈子的ID
     * @return
     * @author yaohuix
     * @date 2016/3/4 16:56
     */
    public GetGroupsInfoReq(String... groupIds) {
        JsonObject jsonObject = new JsonObject();
        String idParams = "";
        for (String groupId : groupIds) {
            idParams = idParams + "," + groupId;
        }
        jsonObject.addProperty("groups", idParams);
        String jsonStr = new Gson().toJson(jsonObject);
        add("data", jsonStr);
    }

    @Override
    public String getUrl() {
        return API.GET_GROUPS_INFO;
    }
}
